3.1.89 \(\int x^{-2+m} \sin ^2(a+b x) \, dx\) [89]

Optimal. Leaf size=101 \[ -\frac {x^{-1+m}}{2 (1-m)}-i 2^{-1-m} b e^{2 i a} x^m (-i b x)^{-m} \Gamma (-1+m,-2 i b x)+i 2^{-1-m} b e^{-2 i a} x^m (i b x)^{-m} \Gamma (-1+m,2 i b x) \]

[Out]

-1/2*x^(-1+m)/(1-m)-I*2^(-1-m)*b*exp(2*I*a)*x^m*GAMMA(-1+m,-2*I*b*x)/((-I*b*x)^m)+I*2^(-1-m)*b*x^m*GAMMA(-1+m,
2*I*b*x)/exp(2*I*a)/((I*b*x)^m)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3393, 3388, 2212} \begin {gather*} -i e^{2 i a} b 2^{-m-1} x^m (-i b x)^{-m} \text {Gamma}(m-1,-2 i b x)+i e^{-2 i a} b 2^{-m-1} x^m (i b x)^{-m} \text {Gamma}(m-1,2 i b x)-\frac {x^{m-1}}{2 (1-m)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^(-2 + m)*Sin[a + b*x]^2,x]

[Out]

-1/2*x^(-1 + m)/(1 - m) - (I*2^(-1 - m)*b*E^((2*I)*a)*x^m*Gamma[-1 + m, (-2*I)*b*x])/((-I)*b*x)^m + (I*2^(-1 -
 m)*b*x^m*Gamma[-1 + m, (2*I)*b*x])/(E^((2*I)*a)*(I*b*x)^m)

Rule 2212

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(-F^(g*(e - c*(f/d))))*((c
+ d*x)^FracPart[m]/(d*((-f)*g*(Log[F]/d))^(IntPart[m] + 1)*((-f)*g*Log[F]*((c + d*x)/d))^FracPart[m]))*Gamma[m
 + 1, ((-f)*g*(Log[F]/d))*(c + d*x)], x] /; FreeQ[{F, c, d, e, f, g, m}, x] &&  !IntegerQ[m]

Rule 3388

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol] :> Dist[I/2, Int[(c + d*x)^m/(E^(
I*k*Pi)*E^(I*(e + f*x))), x], x] - Dist[I/2, Int[(c + d*x)^m*E^(I*k*Pi)*E^(I*(e + f*x)), x], x] /; FreeQ[{c, d
, e, f, m}, x] && IntegerQ[2*k]

Rule 3393

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> Int[ExpandTrigReduce[(c + d*x)^m, Sin
[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f, m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1])
)

Rubi steps

\begin {align*} \int x^{-2+m} \sin ^2(a+b x) \, dx &=\int \left (\frac {x^{-2+m}}{2}-\frac {1}{2} x^{-2+m} \cos (2 a+2 b x)\right ) \, dx\\ &=-\frac {x^{-1+m}}{2 (1-m)}-\frac {1}{2} \int x^{-2+m} \cos (2 a+2 b x) \, dx\\ &=-\frac {x^{-1+m}}{2 (1-m)}-\frac {1}{4} \int e^{-i (2 a+2 b x)} x^{-2+m} \, dx-\frac {1}{4} \int e^{i (2 a+2 b x)} x^{-2+m} \, dx\\ &=-\frac {x^{-1+m}}{2 (1-m)}-i 2^{-1-m} b e^{2 i a} x^m (-i b x)^{-m} \Gamma (-1+m,-2 i b x)+i 2^{-1-m} b e^{-2 i a} x^m (i b x)^{-m} \Gamma (-1+m,2 i b x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.22, size = 117, normalized size = 1.16 \begin {gather*} \frac {2^{-1-m} x^{-1+m} \left (b^2 x^2\right )^{-m} \left (2^m \left (b^2 x^2\right )^m+b (-1+m) x (i b x)^m \Gamma (-1+m,-2 i b x) (-i \cos (2 a)+\sin (2 a))+b (-1+m) x (-i b x)^m \Gamma (-1+m,2 i b x) (i \cos (2 a)+\sin (2 a))\right )}{-1+m} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^(-2 + m)*Sin[a + b*x]^2,x]

[Out]

(2^(-1 - m)*x^(-1 + m)*(2^m*(b^2*x^2)^m + b*(-1 + m)*x*(I*b*x)^m*Gamma[-1 + m, (-2*I)*b*x]*((-I)*Cos[2*a] + Si
n[2*a]) + b*(-1 + m)*x*((-I)*b*x)^m*Gamma[-1 + m, (2*I)*b*x]*(I*Cos[2*a] + Sin[2*a])))/((-1 + m)*(b^2*x^2)^m)

________________________________________________________________________________________

Maple [F]
time = 0.04, size = 0, normalized size = 0.00 \[\int x^{m -2} \left (\sin ^{2}\left (b x +a \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(m-2)*sin(b*x+a)^2,x)

[Out]

int(x^(m-2)*sin(b*x+a)^2,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-2+m)*sin(b*x+a)^2,x, algorithm="maxima")

[Out]

-1/2*((m - 1)*x*integrate(x^m*cos(2*b*x + 2*a)/x^2, x) - x^m)/((m - 1)*x)

________________________________________________________________________________________

Fricas [A]
time = 0.10, size = 77, normalized size = 0.76 \begin {gather*} \frac {4 \, b x x^{m - 2} + {\left (-i \, m + i\right )} e^{\left (-{\left (m - 2\right )} \log \left (2 i \, b\right ) - 2 i \, a\right )} \Gamma \left (m - 1, 2 i \, b x\right ) + {\left (i \, m - i\right )} e^{\left (-{\left (m - 2\right )} \log \left (-2 i \, b\right ) + 2 i \, a\right )} \Gamma \left (m - 1, -2 i \, b x\right )}{8 \, {\left (b m - b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-2+m)*sin(b*x+a)^2,x, algorithm="fricas")

[Out]

1/8*(4*b*x*x^(m - 2) + (-I*m + I)*e^(-(m - 2)*log(2*I*b) - 2*I*a)*gamma(m - 1, 2*I*b*x) + (I*m - I)*e^(-(m - 2
)*log(-2*I*b) + 2*I*a)*gamma(m - 1, -2*I*b*x))/(b*m - b)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{m - 2} \sin ^{2}{\left (a + b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**(-2+m)*sin(b*x+a)**2,x)

[Out]

Integral(x**(m - 2)*sin(a + b*x)**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-2+m)*sin(b*x+a)^2,x, algorithm="giac")

[Out]

integrate(x^(m - 2)*sin(b*x + a)^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x^{m-2}\,{\sin \left (a+b\,x\right )}^2 \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(m - 2)*sin(a + b*x)^2,x)

[Out]

int(x^(m - 2)*sin(a + b*x)^2, x)

________________________________________________________________________________________